import { addDevType } from '@/api/device'
import DeviceConfigInfo from '@/components/card/devConfigInfo'

export default defineComponent({
  setup(props, ctx) {
    const handleFormSubmit = (data: AddDevType.Form) => {
      console.log('增加设备类型表单提交', JSON.stringify(data, null, 2))
      addDevType(data)
        .then(res => {
          location.reload()
        })
        .catch(err => {})
    }
    return () => (
      <div class='w-full h-full overflow-y-auto'>
        <DeviceConfigInfo onSubmit={handleFormSubmit}></DeviceConfigInfo>
      </div>
    )
  }
})
